package com.lesso.cyg.sunflower.app.service.impl;


import com.baomidou.mybatisplus.plugins.Page;
import com.lesso.cyg.sunflower.domain.service.EmployeeDomainService;
import com.lesso.cyg.sunflower.pojo.dto.EmployeeDTO;
import com.lesso.cyg.sunflower.pojo.dto.EmployeeStatusDTO;
import com.lesso.cyg.sunflower.service.IEmployeeService;
import com.lesso.cyg.sunflower.pojo.vo.EmployeeVO;
import com.lesso.cyg.sunflower.pojo.dto.EmployeeQueryDTO;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * EmployeeServiceImpl
 *
 * @author cyg
 * @since 2025-07-02
 */
@Service
@DubboService
public class EmployeeServiceImpl implements IEmployeeService {
    private final EmployeeDomainService employeeDomainService;

    public EmployeeServiceImpl(EmployeeDomainService employeeDomainService) {
        this.employeeDomainService = employeeDomainService;
    }

    @Override
    public Integer save(EmployeeDTO dto) {
        return employeeDomainService.save(dto);
    }


    @Override
    public Page<EmployeeVO> page(EmployeeQueryDTO dto) {
        return employeeDomainService.page(dto);
    }

    @Override
    public Page<EmployeeVO> customPage(EmployeeQueryDTO dto) {
        return employeeDomainService.customPage(dto);
    }

    @Override
    public void deleteById(Long id) {
        employeeDomainService.deleteById(id);
    }

    // 实现更新员工信息的方法
    @Override
    public Integer update(EmployeeDTO dto) {
        return employeeDomainService.update(dto);
    }

    // 实现修改员工状态的方法
    @Override
    public Integer updateEmploymentStatus(EmployeeStatusDTO dto) {
        return employeeDomainService.updateEmploymentStatus(dto);
    }

    @Override
    public EmployeeVO getBy(Long id) {
        return employeeDomainService.getBy(id);
    }

}